<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>animations 3</title>
    <style>

        *{
            margin: 0;
            padding: 0;
        }

        main {
            height: 100vh;
            background-color: cyan;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        @keyframes heart {
            to{
                transform: scale(0) rotate(45deg)
            }
            85%{
                transform: scale(.8) rotate(45deg)
            }
            from{
                transform: scale(1) rotate(45deg)
            }
        }

        @keyframes rotate {
            to{
                transform: rotate(45deg);
            }
            from{
                transform: rotate(45deg);
            }
        }

        div {
            width: 200px;
            height: 200px;
            background-color: red;
            transform: rotate(45deg);
            animation-name: heart;
            animation-duration:1s;
            animation-fill-mode: forwards;
            animation-iteration-count:infinite;
            /* 从100-0 再从0-100 */
            animation-direction:alternate-reverse;
        }

        div::before {
            content: '';
            width: 200px;
            height: 200px;
            background-color: red;
            position: absolute;
            margin-left: -100px;
            border-radius: 50%;
        }

        div::after {
            content: '';
            width: 200px;
            height: 200px;
            background-color: red;
            position: absolute;
            margin-top: -100px;
            border-radius: 50%;
        }

    </style>
</head>
<body>
<main>
    <div></div>
</main>
</body>
</html>
